/*
 * @lc app=leetcode.cn id=125 lang=cpp
 *
 * [125] 验证回文串
 */
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>

using namespace std;
// @lc code=start
class Solution {
public:
    bool isPalindrome(string s) {
        string s1;
        for (char ch: s) {
            if (isalnum(ch)) {
                s1 += tolower(ch);
            }
        }
        string s2(s1.rbegin(), s1.rend());
        return s1 == s2;
    }
};
// @lc code=end

